import request from '@/utils/request';
import qs from 'qs'

// 角色列表
export function rolelist(data?: any) {
	return request({
		url: 'api/sysRole/list'+ '?' + qs.stringify(data, { indices: false }),
    method: 'get',
    data
	});
}
// 添加权限
export function add(data: RoleDto) {
	return request({
		url: 'api/sysRole/save',
    method: 'post',
    data
	});
}

// 修改权限
export function edit(data: RoleDto) {
	return request({
		url: 'api/sysRole/update',
    method: 'post',
    data
	});
}

// id查询权限
export function info(id: string):Promise<IResponseType<RoleDto>> {
	return request({
		url: 'api/sysRole/info/' + id,
		method: 'get',
	});
}

// 删除权限
export function del(data: any) {
	return request({
		url: 'api/sysRole/delete',
    method: 'post',
    data
	});
}

export function perm(id:string,data: any) {
  return request({
    url: 'api/sysRole/perm/'+id,
    method: 'post',
    data
  })
}